package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the status database table.
 */
@Entity
@Table(name = "status")
@NamedQueries({
        @NamedQuery(name = "Status.findAll", query = "SELECT s FROM Status s"),
        @NamedQuery(name = "Status.findById", query = "SELECT s FROM Status s WHERE s.id = :id"),
        @NamedQuery(name = "Status.findByWorkingStatus", query = "SELECT s FROM Status s WHERE s.workingStatus = :workingStatus")})
public class Status implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Lob()
    @Column(nullable = false)
    private String description;

    @Column(name = "working_status", nullable = false, length = 1)
    private String workingStatus;

    // bi-directional many-to-one association to Employee
    @OneToMany(mappedBy = "status")
    private List<Employee> employees;

    public Status() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getWorkingStatus() {
        return this.workingStatus;
    }

    public void setWorkingStatus(String workingStatus) {
        this.workingStatus = workingStatus;
    }

    public List<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

}